package com.ddw.meedeeuh.shared.movie.database;

public abstract class DBActorFactory {

	public static DBActor create(int actorId, int movieId, String name, String role) {
		if(name == null) {
			throw new IllegalArgumentException("The parameter name cannot be null");
		}

		return new DBActorImpl(actorId, movieId, name, role);
	}

	private static class DBActorImpl implements DBActor {

		private final String name;
		private final String role;
		private final int actorId;
		private final int movieId;

		public DBActorImpl(int actorId, int movieId, String name, String role) {
			this.name = name;
			this.role = role;
			this.actorId = actorId;
			this.movieId = movieId;
		}

		@Override
		public String getName() {
			return this.name;
		}

		@Override
		public String getRole() {
			return this.role;
		}

		@Override
		public int getActorId() {
			return this.actorId;
		}

		@Override
		public int getMovieId() {
			return this.movieId;
		}

	}

}
